import java.util.Scanner;

//杨辉三角
public class test3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();//输入行数 --> 第几行就有几个数
        int[][] arr = new int[n][n];
        //第一列
        for (int i = 0; i < n; i++) {
            arr[i][0] = 1;
        }
        //最后一列
        for (int i = 0; i < n; i++) {
            arr[i][i] =1;
        }
        //中间
        if (n>2){//要有三列
            for (int i = 2; i <n ; i++) {
                for (int j = 1; j < i; j++) {
                    arr[i][j] = arr[i-1][j-1]+arr[i-1][j];
                }
            }
        }


        for (int i = 0; i < n; i++) {
            for (int j = 0; j <=i ; j++) {
                System.out.printf("%5d",arr[i][j]);
            }
            System.out.println();
        }
    }
}
